#ifndef DEMO_UTIL
#define DEMO_UTIL

#include "common.h"

void ReadFile(const char* name, int* len, void* buf);

void NegtiveVector(float* src, float* rst);
void AddVectorVector(float* l, float* r, float* rst);
void MultiplyVectorFloat(float* vec, float k, float* rst);

void DotVectorVector(float* l, float* r, float* rst);
void CrossVectorVector(float* l, float* r, float* rst);
void NormalizeVector(float* src, float* rst);
void MultiplyMatrixVector(float* mat, float* vec, float* rst);
void MultiplyMatrixMatrix(float* l, float* r, float* rst);
void TransposeMatrix(float* src, float* rst);
void InverseMatrix(float* src, float* rst);

void GenMatrixLookAt(float* eye, float* center, float* top, float* rst);
void GenMatrixPerspectiveProject(float fov, float wh, float n, float f, float* rst);
void GenMatrixRotateZ(float angle, float* buffer);
void GenMatrixRotateY(float angle, float* buffer);
void GenMatrixRotateX(float angle, float* buffer);
void GenMatrixIdentity(float* buffer);
void GenMatrixTanslate(float x, float y, float z, float* buffer);
void GenMatrixScale(float x, float y, float z, float* buffer);

void GenGeometryRhom(int* vlen, int* ilen, float* pos, float* color, int* index);

#endif//DEMO_UTIL